UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CGAGq3QDk67XYEbPkbO7CFEa/3UQUcs8j0rsf7Jxsmw='
WHERE
key_id = '0518fd8effbcdc6dcecaae61cef4f8f94f6736650c85ac711cffa7bce33c6bfb'
AND (
token = 'CGAGq3QDk67XYEbPkbO7CFEa/3UQUcs8j0rsf7Jxsmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)