UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q2+RsSme4b11m+L89EnkCJkd7Pe5A6KWhY+c5iHKAq0='
WHERE
key_id = '958ad9eb54a608f40cea0640991461647dca19ebc4771211efc64ec8b8d366e1'
AND (
token = 'Q2+RsSme4b11m+L89EnkCJkd7Pe5A6KWhY+c5iHKAq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)