UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W8YEvVJMbDU12WtMnBJHfhieadgnVc9bhdia9fIXH+I='
WHERE
key_id = '45d76f2c1addd64aa2c0cf7dc8e0bf28c28ab26271f73563963aa53b13083d72'
AND (
token = 'W8YEvVJMbDU12WtMnBJHfhieadgnVc9bhdia9fIXH+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)