UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r2Y1tmmrPaQfzSYYxA38sUNLPwBRmQkNbAeBmzxlCpM=' 
WHERE 
  key_id = '72b9343971d19c77648f0b5b75fee8a4af63fb98d0c304369190c53f9e60a46d' 
  AND (
    token = 'r2Y1tmmrPaQfzSYYxA38sUNLPwBRmQkNbAeBmzxlCpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030