UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DyRGJxBW7M4RGCGFiSOzH0PWL59JPSh8OTlOHROytGQ='
WHERE
key_id = 'e18f3ddff8b38fb3b1f44fb0c3ca072323a8dbba6e341d50cd2ac3db885f92b2'
AND (
token = 'DyRGJxBW7M4RGCGFiSOzH0PWL59JPSh8OTlOHROytGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)