UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vFVNQRkhmJ/pStIX6WJVujMzOoWP+0EiCWW8IPKgbgk='
WHERE
key_id = '4bad8105a99abca19f483dbe025434ca1190981bfc9363a273c13e94052b5610'
AND (
token = 'vFVNQRkhmJ/pStIX6WJVujMzOoWP+0EiCWW8IPKgbgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)