UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PGdT8rUQ5sRT5Seu0mp+Lr2YtqDBUZ485jNNwsW9Rk4='
WHERE
key_id = 'c961a11e5c79d0184ddd93675033852036c87f29a7fc912fcefe3a0e0bef4e3c'
AND (
token = 'PGdT8rUQ5sRT5Seu0mp+Lr2YtqDBUZ485jNNwsW9Rk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)