UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rxMwsPM9F/eaViVA1kZdtFHCjgJIPFE7E9h/mGIZFho=' 
WHERE 
  key_id = '180dbd23a7a11986dbcb6dfb85548d6c2251fbb3c7c3b491bc6b3619038a04bf' 
  AND (
    token = 'rxMwsPM9F/eaViVA1kZdtFHCjgJIPFE7E9h/mGIZFho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043