UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gbuXGWL3drVC0wqN+I5b2mTfr4y5hkWCUqxZ7CEuy3s='
WHERE
key_id = 'a89633b48db5dcdae433a06686aec2f61bff6419bc2ec34b63d3d98b90594a15'
AND (
token = 'gbuXGWL3drVC0wqN+I5b2mTfr4y5hkWCUqxZ7CEuy3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)