UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tBsKLrhEdaHaXhSdcaAuyREXX4zKodiPp1mCaraJH64=' 
WHERE 
  key_id = '6c2b349166eb4cd8f205b12d465a4fc43038bb13ad721430d9bbd66a62489c55' 
  AND (
    token = 'tBsKLrhEdaHaXhSdcaAuyREXX4zKodiPp1mCaraJH64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049