UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZP261EStWlceP3ZorofP64l2zKo1SISDeZL8192Fg3s=' 
WHERE 
  key_id = '574feb7ccb6661d09c63202f75963a7fe814a81a5056e524a1dd7e08bd62a87f' 
  AND (
    token = 'ZP261EStWlceP3ZorofP64l2zKo1SISDeZL8192Fg3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030