UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dnEgT+/whHArUVR+1io5wZaxHFKmsLZohebL/4SnIfk='
WHERE
key_id = '71f457cf3356a6ea0148e909c6d60df1440c9f32cb3837b2e2c88add4d3fa8d5'
AND (
token = 'dnEgT+/whHArUVR+1io5wZaxHFKmsLZohebL/4SnIfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)