UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j99CtbRE9/vO0UF8rdLa6fnWYQ9uTKRuqq1ytAOR9uo='
WHERE
key_id = '6f6c0e3816ecee076273475fee1dbd79310b88ae8a2d6a3b01217f37c73221d8'
AND (
token = 'j99CtbRE9/vO0UF8rdLa6fnWYQ9uTKRuqq1ytAOR9uo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)