UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UKzgwxxUa7y6LJ8c4rpJUYn5AhPSVBp8YKCMzu87dC4='
WHERE
key_id = '3ad8753de45937cd85f43e392ba24d27c2a752c46de7fc95af607b83573afd10'
AND (
token = 'UKzgwxxUa7y6LJ8c4rpJUYn5AhPSVBp8YKCMzu87dC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)