UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4q6jmE4aa1qu3SckV1SD01hVqJLWP20UD5U0BY+3/Ys='
WHERE
key_id = '1b53b2ae99f79eac2c14d7ff7e8c72dbf56e92f8edbcba56bd9c423e516aed17'
AND (
token = '4q6jmE4aa1qu3SckV1SD01hVqJLWP20UD5U0BY+3/Ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)