UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'usbEgstglWQGYN1wzknmI/mC2wnz3D5/uv1y8Cr5KGM='
WHERE
key_id = '0befe1a61fef7760abc42fc802cc05c260d7214d25c41fad7e35b4d32ebb9e64'
AND (
token = 'usbEgstglWQGYN1wzknmI/mC2wnz3D5/uv1y8Cr5KGM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)