UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qHEMDwsPdHiI/jhBn1tzuRPhzJenjf2WNugYg/BYhiw='
WHERE
key_id = '8fca2b6cb72e8f47401d5f6cf540c42fd0b61f83f7005d9f8c2d0075f2661de3'
AND (
token = 'qHEMDwsPdHiI/jhBn1tzuRPhzJenjf2WNugYg/BYhiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)