UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FdYJ7FjOggbu1G+dNwTk9s7qW6NxBKbyIflo0yFHyak='
WHERE
key_id = '1976d4ab6afdd7bbd7e73ae78d6ff7c0203a4a4deb9e4077b34620dca0ede34f'
AND (
token = 'FdYJ7FjOggbu1G+dNwTk9s7qW6NxBKbyIflo0yFHyak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)