UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8E6XGPKapGFeUoPpOzscW/3KwHDgLh14HfQEECd5wUs=' 
WHERE 
  key_id = 'd12380e75dda9d083ae06ac67b143f63caa891eccfe651d1eb90cfd16ba7abc1' 
  AND (
    token = '8E6XGPKapGFeUoPpOzscW/3KwHDgLh14HfQEECd5wUs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025