UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Bdl/v1r7cIxwtd+Owpu1bnGSabFg4GzD71zLFpjDnw=' 
WHERE 
  key_id = '48679e1c1fca390880871189a904c76452d359bee904c4b6eb638acd51175714' 
  AND (
    token = '9Bdl/v1r7cIxwtd+Owpu1bnGSabFg4GzD71zLFpjDnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029