UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nCTur427OcSx+qVEaUanHYOL7AYb954QRQ4AVgsNZII='
WHERE
key_id = '94940625f9d234d2a2b5bf291832e4567d33db6700f425793a0ed85a813af4e8'
AND (
token = 'nCTur427OcSx+qVEaUanHYOL7AYb954QRQ4AVgsNZII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)