UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fxOO5kbewUq43NT2xeW3IhGCqyZwLW+I7+EQXNTHMgs='
WHERE
key_id = 'a72d8854c9c9c634b0a0f2ceeec06b10bd0fd61f33499c85101a45f6cf115f20'
AND (
token = 'fxOO5kbewUq43NT2xeW3IhGCqyZwLW+I7+EQXNTHMgs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)