UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aulSuRh9upZahuWWRGNLN2XM0sQ7fw4061xOfU6/p/Q=' 
WHERE 
  key_id = '0364a94571f08df6454552a2b0591885ba1dfaa02c1372632d496b220e36e0ab' 
  AND (
    token = 'aulSuRh9upZahuWWRGNLN2XM0sQ7fw4061xOfU6/p/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019