UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1vwIZw+2HoTwnjzbufBtoz+6NrFsWkQK2lD1aIl0H3o='
WHERE
key_id = 'c35e13f368df7272dccbe39575f9df7b845158a419ac72fc766190e0102f6b64'
AND (
token = '1vwIZw+2HoTwnjzbufBtoz+6NrFsWkQK2lD1aIl0H3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)