UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fLM4XA1EOtlqteUIOoHUuoVYnBNvrJk18OGm2TSnpTI='
WHERE
key_id = 'f2e54d2e5dbf33342966bfc675178b1e994d1255ba5ec177484759596585f54c'
AND (
token = 'fLM4XA1EOtlqteUIOoHUuoVYnBNvrJk18OGm2TSnpTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)