UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UF8jDsCyfczkG/cosMaKExHlPQrHGbwbscCjHVUNt1Y=' 
WHERE 
  key_id = '4fb73e260a076dadf26e279a5110571e9ea2b40f859a6734797f2ef86ab747bd' 
  AND (
    token = 'UF8jDsCyfczkG/cosMaKExHlPQrHGbwbscCjHVUNt1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043