UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YRGRnT/ut8SQpu8JAjjSZcOV1ot8InsS6tGfWqf/F6E='
WHERE
key_id = 'efa7e512aac12c3e4ffae47282beac41f5a401ed024ac5f6dfb3849b826c0ecd'
AND (
token = 'YRGRnT/ut8SQpu8JAjjSZcOV1ot8InsS6tGfWqf/F6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)