UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jma+yt7TGaR1mvoemynbzSZXw2HsfCEAQOJ8xibnSO0='
WHERE
key_id = 'bc9a8fbcfa28d900579d114cf43cb21611f675446726e644b637c597f5cfed4a'
AND (
token = 'jma+yt7TGaR1mvoemynbzSZXw2HsfCEAQOJ8xibnSO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)