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

Query time 0.00051