UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h8VcJ4kPP5VCRISN4AYH7nSK0tjZKzMmG4eXG8DkMno=' 
WHERE 
  key_id = '58dca408f1d290ed7094ee7d4cc483ccd63986b5055cf4e488eaa931a0c1ee7b' 
  AND (
    token = 'h8VcJ4kPP5VCRISN4AYH7nSK0tjZKzMmG4eXG8DkMno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048