UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+uM0AThdOY9hMNUBsoKyoJJ5024SaEUNfxjarX5yTCg='
WHERE
key_id = '94efb8249cc3cab58a53d2be9de9e90d339c8abde1855a9ba331db5fcb255000'
AND (
token = '+uM0AThdOY9hMNUBsoKyoJJ5024SaEUNfxjarX5yTCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)